package com.jt.friendsmanagement;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import java.util.UUID;

public class AddFriendActivity extends SingleFragmentActivity {
    private static final String EXTRA_FRIEND_ID =
            "com.jt.friendsmanagement.friend_id";
    private Friend mFriend;

    public static Intent newIntent(Context packageContext, UUID friendID) {
        Intent intent = new Intent(packageContext, AddFriendActivity.class);
        intent.putExtra(EXTRA_FRIEND_ID, friendID);
        return intent;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        UUID Id = (UUID) getIntent().getSerializableExtra(EXTRA_FRIEND_ID);
        mFriend = FriendLab.get(AddFriendActivity.this).getFriend(Id);
    }

    @Override
    protected Fragment createFragment() {
        UUID friendId = (UUID) getIntent()
                .getSerializableExtra(EXTRA_FRIEND_ID);
        return AddFriendFragment.newInstance(friendId);
    }
}
